//
//  NinethChapterViewController.m
//  CoreAnimation
//
//  Created by 张国文 on 16/10/28.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "NinethChapterViewController.h"
#import "AnimationMediaTimingViewController.h"
#import "CAMediaTimingFunctionImageViewController.h"
#import "UseCAKeyFrameMediaTimeFunctionOnBallViewController.h"
#import "ProcessAutomatismViewController.h"

@interface NinethChapterViewController ()

@end

@implementation NinethChapterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton *firstButton = [UIButton buttonWithType:UIButtonTypeCustom];
    firstButton.frame = CGRectMake(0, 20, 360, 50);
    [firstButton setTitle:@"动画速度-CAMediaTimingFunction" forState:UIControlStateNormal];
    [firstButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    firstButton.tag = 100;
    [firstButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:firstButton];
    
    UIButton *sectionButton = [UIButton buttonWithType:UIButtonTypeCustom];
    sectionButton.frame = CGRectMake(0, 70, 360, 50);
    [sectionButton setTitle:@"CAMediaTimingFunction图像" forState:UIControlStateNormal];
    [sectionButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    sectionButton.tag = 101;
    [sectionButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:sectionButton];

    UIButton *thirdButton = [UIButton buttonWithType:UIButtonTypeCustom];
    thirdButton.frame = CGRectMake(0, 120, 360, 50);
    [thirdButton setTitle:@"基于关键帧的缓冲-模拟小球掉落" forState:UIControlStateNormal];
    [thirdButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    thirdButton.tag = 102;
    [thirdButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:thirdButton];
    
    UIButton *progressAutoButton = [UIButton buttonWithType:UIButtonTypeCustom];
    progressAutoButton.frame = CGRectMake(0, 170, 360, 50);
    [progressAutoButton setTitle:@"流程自动化-模拟小球掉落" forState:UIControlStateNormal];
    [progressAutoButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    progressAutoButton.tag = 103;
    [progressAutoButton addTarget:self action:@selector(clickJump:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:progressAutoButton];
}

- (void)clickJump:(UIButton *)button
{
    switch (button.tag) {
        case 100:
        {
            AnimationMediaTimingViewController *animationMediaTimingVC = [[AnimationMediaTimingViewController alloc] init];
            [self.navigationController pushViewController:animationMediaTimingVC animated:YES];
            break;
        }
        case 101:
        {
            CAMediaTimingFunctionImageViewController *caMediaTimingFunctionImageVC = [[CAMediaTimingFunctionImageViewController alloc] init];
            [self.navigationController pushViewController:caMediaTimingFunctionImageVC animated:YES];
            break;
        }
        case 102:
        {
            UseCAKeyFrameMediaTimeFunctionOnBallViewController *useCAkeyOnBallVC = [[UseCAKeyFrameMediaTimeFunctionOnBallViewController alloc] init];
            [self.navigationController pushViewController:useCAkeyOnBallVC animated:YES];
            break;
        }
            case 103:
        {
            ProcessAutomatismViewController *processAutomatismVC = [[ProcessAutomatismViewController alloc] init];
            [self.navigationController pushViewController:processAutomatismVC animated:YES];
            break;
        }
        default:
            break;
    }
}

@end
